#pragma once
#include "state.h"
#include "OgreNewt_ContactCallback.h"
#include "TimeMgr.h"

class PhyState :
	public State,OgreNewt::ContactCallback,TimeListener
{
public:
	PhyState(void);
	~PhyState(void);
	virtual void init();
	virtual void stateStarted();
	virtual void stateEnded();
	void timeUp();
	int onAABBOverlap( OgreNewt::Body* body0, OgreNewt::Body* body1, int threadIndex );
	void contactsProcess( OgreNewt::ContactJoint &contactJoint, Ogre::Real timeStep, int threadIndex );
private:
	float stabletime;
	bool stable;
	void createMaterials();
};

